ABC - Pareto Analysis - dax

I have a dataset like this and I try to replicate a youtube video but I can't do it and I don't understand why.
Someone can help me?
This is the video
https://www.youtube.com/watch?v=UVxiLc_AzSs
Fatturato cumulato = calculate([NET], WINDOW(1,ABS, [RANK], ABS, SUMMARIZE(ALLSELECTED('Name'), 'Name', "importo",[NET]), orderby([importo], DESC)))

Related

Prolog program to search book by book_title ,by book_author, by book_edition using recursion

I am trying, but unable to solve this as I am totally new to Prolog. Anybody can help to solve it?
My Code:
firstBook(the_design_of_everyday_things,don_normas,third_edition).
secondBook(elementary_statistics,a_step_by_atep_approach,fourth_edition).
thirdBook(beginning_linux_programming,neil_methew,third_edition).
Find_book:-
repeat,nl,
write('Book Lists:'),nl,
write('1. Human Computer Interaction'),nl,
write('2. Probability and Statistics'),nl,
write('3. Operating System'),nl,nl,
read(Opt),
{
Opt = 4,
write('Not Available'),!
;
selectedchoice(Opt),
fail
}.

Python plot multiple z-test result with confidence interval (visualize A/B test results)

what I want to plot
Hi, I want to visualize results for one A/B test. The experiment tracks 4 metrics, and I want to show them in one plot altogether. The schema of my dataframe is:
test_control | metric1 | metric2 | metric3 | metric4
Does anyone know how to plot, by matplotlib, pandas or seaborn?
Thanks in advance!
I found it's probably easier to be done in R.
In python, I calculated the error bar and then used matplotlib.pyplot.errorbar to plot:
get CI
kpi_map = {'kpi':[], 'mean_diff':[], 'err':[], 'pval':[]}
for col in metrics:
sp1 = df.loc[df['test_control']=='test'][col]
sp2 = df.loc[df['test_control']=='control'][col]
std1 = np.std(sp1, ddof=1)
std2 = np.std(sp2, ddof=1)
mean_diff_std = (std1**2/len(sp1) + std2**2/len(sp2)) **0.5
mean_diff = sp1.mean() - sp2.mean()
kpi_map['kpi'].append(col)
kpi_map['mean_diff'].append(mean_diff)
kpi_map['err'].append(1.96*mean_diff_std)
plot
df_kpi = pd.DataFrame(data = kpi_map)
plt.errorbar(y=df_kpi['kpi'], x=df_kpi['mean_diff'], xerr=df_kpi['err'], fmt='o', elinewidth=2, capsize=4, capthick=2)

How to make "less than" function in Prolog?

As i am new to Prolog i made this program but having a lot of troubles can anyone help me?
below is my code:
android(samsung,s10,brown,90000).
android(huwawei,mate10lite,black,34000).
android(oppo,f9,blue,20000).
featured(nokia,1110,brown,10000).
featured(qmobile,q3,black,24000).
featured(gfive,g300,blue,30000).
amount(X,Y,Z,A):-
android(X,Y,Z,A),
A > 25000,
featured(X,Y,Z,A),
A>25000.
fun:-
amount(X,Y,Z,A),
writef("cellphone having less than 25K is",[X],[Y],[Z],[A]),
fail.
i don't know what is the issue if anyone can help please help me out.
when ever i am calling fun it's returning false.
Evidently,
amount(X,Y,Z,A):-
android(X,Y,Z,A), <---+
A > 25000, +--- exactly as for X,Y,Z, this is the SAME A
featured(X,Y,Z,A), <---+
A>25000. <------- ... so you've already tested this!
you really want to have a B:
amount(X,Y,Z,A):-
android(X,Y,Z,A),
A > 25000,
featured(X,Y,Z,B),
B =< 25000.
And why do you fail. at the end of fun? That doesn't sound like fun at all!

Random sample for y variable in catplot seaborn

I'm new to python and trying to create catplot (stripplot and swarmplot) with a jitter in seaborn for x='region' and y='amount' using a random sample of 300 from my y variable. I have tried:
data_sample = data.sample(300)
y = data_sample['amount']
plt.figure(figsize=(8,8))
sns.catplot('region', y, data=data, jitter='1', kind='strip')
Which produces:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()
Can anyone explain what this error means and how to resolve? Also, below the long list of error recommendations it is actually showing a visual of a catplot, labeled with 'Figure size 2160x2160 with 0 Axes.'
Thank you, help appreciated.

How to set discount value in Quick Book?

I am trying to apply discount value in Quick book but for some reason discount does not apply in Quickbook. Can you please guide me how can i resolve this issue?
https://github.com/ruckus/quickbooks-ruby/issues/267
Discount value code:
discount_amount = discount_value
discount_line_item = Quickbooks::Model::InvoiceLineItem.new
discount_line_item.amount = discount_amount#149
discount_line_item.discount_item! do |detail|
detail.discount_account_id = 48
end
Discount percentage code:
discount_line_item = Quickbooks::Model::InvoiceLineItem.new
discount_line_item.amount = discount_percentage_value#149
discount_line_item.discount_item! do |detail|
detail.discount_percent = discount_percentage_value#60
detail.percent_based = percent_based
detail.discount_account_id = 48
end
invoice.line_items << discount_line_item
I did a google search and fount this link that may be useful in solving your issue. Otherwise, there's no way we can help you; is the application timing out, is the data not being posted to quickbooks, is there an error in your log file?

Resources