Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Bobbet
Contributor III
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
Taoufiq_Zarra

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") 😉
Bobbet
Contributor III
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

Taoufiq_Zarra

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") 😉
Bobbet
Contributor III
Contributor III
Author

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

Bobbet_0-1588473621530.png

 

Taoufiq_Zarra

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") 😉
Bobbet
Contributor III
Contributor III
Author

I removed that condition, same results. No values. 

 

Bobbet_0-1588490548582.png

 

sophiaolivia
Contributor
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.
shivanisapkale
Partner - Creator
Partner - Creator

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

Bobbet
Contributor III
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