Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

textbox termy sales

hi there,

ı have a table like that ;

  

termsales
20171190
20171090
20170991
20170890
20170789
20170688
20170586
20170485
20170384
20170282
20170181
20161280
20161179
20161079
20160977
20160877
20160775
20160676
20160573
20160474
20160372
20160271
20160170
20151270
20151169
20151068
20150966
20150866

I want to write in the textbox  that ;

"the sales in the month 201512 are 70"

201512 is (current month- 24 months) (moving)

thanks for helps.

1 Solution

Accepted Solutions
sunny_talwar

May be this

'the sales in the month ' & Max({<term = {"=term = Num#(Date(MonthStart(Today(), 1), 'YYYYMM')) - 200"}>}term) & ' are ' & Sum({<term = {"=term = Num#(Date(MonthStart(Today(), 1), 'YYYYMM')) - 200"}>} sales)

View solution in original post

9 Replies
sunny_talwar

May be this

'the sales in the month ' & Max({<term = {"=term = Num#(Date(MonthStart(Today(), 1), 'YYYYMM')) - 200"}>}term) & ' are ' & Sum({<term = {"=term = Num#(Date(MonthStart(Today(), 1), 'YYYYMM')) - 200"}>} sales)

Anonymous
Not applicable
Author

thnks my friend,

then what if I want to add a second dimension like that, I could not fix the set analysis;

termflag1sales
201711a90
201710a90
201709a91
201708a90
201707a89
201706b88
201705b86
201704b85
201703b84
201702b82
201701b81
201612a80
201611a79
201610a79
201609a77
201608a77

I want to call the sales filtered by flag1 (also all other flags (listboxes etc.) should be excluded, do not influence the sum)

I need an adjustment in set analysis I think,

thanks for your helps

sunny_talwar

Not sure I understand... what is the expected output from this new sample data?

Anonymous
Not applicable
Author

sorry for the sample, was not clear,

I revised ;

termflag1sales
201711a90
201710a90
201710b91
201709a90
201708a89
201707b88
201706b86

there are 2 of 201710 , a and b

I want to take the one flag1=a

"the sales in the month 201710 and a (flag1) are 90"

in brief I want to add a filter to the set analysis that you sent.

sunny_talwar

How do you decide which term do you want to see? Is this random or is there a logic behind this?

Anonymous
Not applicable
Author

ı just want to use multiple filters other than only term, ı want to add other filters to set expression

sunny_talwar

Something like this

'the sales in the month ' & Max({<term = {"=term = Num#(Date(MonthStart(Today(), 1), 'YYYYMM')) - 200"}, flag1 = {'a'}>}term) & ' are ' & Sum({<term = {"=term = Num#(Date(MonthStart(Today(), 1), 'YYYYMM')) - 200"}, flag1 = {'a'}>} sales)

Anonymous
Not applicable
Author

thats it, thanks!

Anonymous
Not applicable
Author

than I also want to write in textbox someth like;

'in the last (12) months of term, rank=1 and rank=2 sum(sales) are .....  and in these months..... '

again I am having difficulty with the syntaxes of set analysis.............