Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
jyothish8807
Master II
Master II

Qlik Requirement

Hi All,

I have two tables associated to each other based on "Name" field and as the per data one user can have more that two profiles.

What i want is to create a staked bar chart, with Month as 1st dimension, Profile as 2nd dimension and sum of Sale as measure.

The catch is if a user (eg A) have two profiles, then when creating the Bar chart, the user A should be counted under "Profile 1" only. The same goes for User B but User C should be considered under Profile 2 as he have only 1 Profile.

I would like to achieve this in front end. Thank you in advance !

  Table 1
MonthNameSal
JanA10
JanB12
FebA20
FebB20
FebC10

 

 Table 2
NameProfile
AProfile 1
AProfile 2
BProfile 1
BProfile 2
CProfile 2

 

Expected O/P

MonthNameProfileSal
JanAProfile 110
JanBProfile 112
FebAProfile 120
FebBProfile 120
FebCProfile 210
Best Regards,
KC
7 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Something like this perhaps:

Load Month,Name,Sal From Table1;

LEFT JOIN (Table1)

Load Name, MinString(Profile) as Profile From Table2 Group By Name;


talk is cheap, supply exceeds demand
jyothish8807
Master II
Master II
Author

Hi @Gysbert_Wassenaar ,

Thank you for your suggestion, but i cannot do a join in the script because of my current data model.Also in my other reports i will have to show that User A have two profiles.

How can we achieve this in front end.

Best Regards,
KC
tresB
Champion III
Champion III

Like this?

tresesco_0-1631797397393.png

 

jyothish8807
Master II
Master II
Author

Hi @tresB ,

Yes, something similar but i cannot use min or max string as this ia an example and my actual Profile names may vary. Yes, but we can hard code "Profile 2" to be excluded if the user have any other Profile along with Profile 2.

Best Regards,
KC
CELAMBARASAN
Partner - Champion
Partner - Champion

Will this work for you?

Coalesce(MinString({<Profile={'Profile 1'}>}Profile),MinString(Profile))

tresB
Champion III
Champion III

Hi Jyothish,

So the logic would be like - exclude only 'Profile 2' if there are multiple profiles per month, per name. That means - if there are four profiles for one month and one name - only one (profile 2) should be removed and rest all remain ?

jyothish8807
Master II
Master II
Author

No, this doesn't help. Thank you for your input  🙂

Best Regards,
KC