New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Join “Do More With Qlik” with Mike Tarallo to get a first-hand look at the New Authoring Experience, June 29th: REGISTER HERE
cancel
Showing results for
Did you mean:
Contributor III

Set analysis using variable Year does not provide values

Hi,

I have the following statement and it seems the values are not displaying.  I suspect that the vLastYear variable is the issue. Hope to get inputs. Thanks!

count({\$<transaction_type-= {'Union_Bank'}, Year={\$(vLastYear)}>} distinct transaction_id)

Bobbet

10 Replies

the formula seems correct, can you share the formula to calculate vLastYear ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Contributor III
Author

Hi Taoufiq ZARRA,

Here is the complete formula:

(count({\$<transaction_type-= {'Union_Bank'}, Year={\$(vCurrentYear)}>} transaction_id)/
count({\$<transaction_type-= {'Union_Bank'}, Year={\$(vLastYear)}, MonthNum={"<=\$(vMaxMonthNum)"}>} transaction_id)) -1

Thanks

Bobbet

Hi Bobbet

always the syntax seems correct.
vCurrentYear, vLastYear, vMaxMonthNum returns the correct values?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Contributor III
Author

Yup, they are returning the correct values. Funny thing, results are zero or nil.  Here is the screenshot. Thanks!

now you have to see the semantics of the formula, for example '-=' or 0 is 1(same values in numerator and denumerator)-1 =0 ...

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Contributor III
Author

I removed that condition, same results. No values.

Contributor
Liaoning YNN Technology Co., Ltd is the leading [url=https://www.ynnpackaging.com/product/protective-film/]surface protective film supplier[/url] and technical service provider and located in Liaoning, China. Our company specializes in the design, manufacture, sale and servicing of protective film, shrink film, composite flexible packaging materials. Promoted a series of products, which is based on the safety and environment friendly. Our products include but are not limited to: protective film, shrink film, packing bag, food packaging, cosmetic packaging, and electronics packaging.
Partner

Hi,

Take all the variables in Kpi and see what output ur getting and is that the same with your current output,if it is coming correct in kpi and not here then u must be having some bracket issue.

The calculation which ur performing calculate numerator separately and denominator separately and check values are correct  when calculated separately?

Regards,

Shivani Sapkale

Contributor III
Author

Hi Shivani,

I broke down the set analysis statement into two. Both gives the same value. Could be an issue on the variables for current and last year?

Thanks

Bobbet