Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
ngrunoz
Contributor II
Contributor II

Conditional Flagging

I have  data in CSV and I would want to flag the data if it meet the below Criteria. I want that data to create a summary table counting number of Citrizens who fall in the criteria of the parameters below

Criteria Table

QuestionNorm
D.O.B01/01/1990 - 31/12/2000
Family SizeNumeric
Employment StatusAll Except Retired
Education LevelHigh School (or) Primary  (of) Both
IDAlphanumeric
TransactionTypeCredit Card (&) Cash

Expected Summary results

QuestionNumber Of Citizen
D.O.B1
Family Size3
Employment Status2
Education Level For Dependencies1
ID3
TransactionType

1

That for example if the question is D.O.B then it will count the number of citizen who have the response which fall in between 01/01/1990  &  31/12/2000; if the question is Employment Status then it counts all the Citizens with employment status which is not Retired ......... etc.

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Check this?

Using Straight table chart.

Add Question as Dimension

Expr:

= Pick(Match(Question, 'Ave Income','D.O.B','Education Level For Dependencies','Employment Status','Family Size','ID','Retailer','TransactionDate','TransactionType'),

                       Sum(Response), Count({<Response = {'>=01/01/1990 <= 31/12/2000'}  >} CitizenCode),

                       Count({< Response = {'High School, University','Primary , Collage','University , Primary , High School'} >}CitizenCode),

                       Count({< Response -= {'Retired'} >}CitizenCode),

                       Count(CitizenCode),

                       Count(CitizenCode), 

                       Count(CitizenCode),

                       Count(CitizenCode),

                       Count({< Response = {'Credit Card','Cash'}>}CitizenCode)

       )

You can change the expression accordingly.

Capture.PNG

Your Load will be like:

DATA:

LOAD CitizenCode,

     Question,

     Response

FROM

[Citizen Info With Parameters.csv]

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

View solution in original post

5 Replies
vishsaggi
Champion III
Champion III

Check this?

Using Straight table chart.

Add Question as Dimension

Expr:

= Pick(Match(Question, 'Ave Income','D.O.B','Education Level For Dependencies','Employment Status','Family Size','ID','Retailer','TransactionDate','TransactionType'),

                       Sum(Response), Count({<Response = {'>=01/01/1990 <= 31/12/2000'}  >} CitizenCode),

                       Count({< Response = {'High School, University','Primary , Collage','University , Primary , High School'} >}CitizenCode),

                       Count({< Response -= {'Retired'} >}CitizenCode),

                       Count(CitizenCode),

                       Count(CitizenCode), 

                       Count(CitizenCode),

                       Count(CitizenCode),

                       Count({< Response = {'Credit Card','Cash'}>}CitizenCode)

       )

You can change the expression accordingly.

Capture.PNG

Your Load will be like:

DATA:

LOAD CitizenCode,

     Question,

     Response

FROM

[Citizen Info With Parameters.csv]

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

Anil_Babu_Samineni

Like this? May be Helps

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ngrunoz
Contributor II
Contributor II
Author

is there a way of doing it in script in the event that they are a lot of conditions.

vishsaggi
Champion III
Champion III

I think it is kind of tricky may be possible but need to group by the fields and create individual fields for each Question and expression. Personally Pick(Match()) in the chart expression is more feasible option. If time permits will try script level. Sorry about that.

ngrunoz
Contributor II
Contributor II
Author

Thanks.