Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
harson
Contributor III
Contributor III

Display text data in Table Expression

Hello community,

Beginner on QlikView, I need help to create a table that I can't do,

I would like to have something like this (with Total) :

Capture.PNG

But in my table on QlikView, text data "CP" and "CM" are not displayed.

I put like Expression :

=if(jour = 11 and [temps prod]='CP','CP',
        if(jour = 11 and [temps prod]='CM','CM',
              Interval( sum(if(jour = 11, [temps prod])) ,'hh:mm:ss')
        )
)

in attached my QVW file and below the txt data,

Thanks in advance for your help

 

DATA.txt :

 

Agent;agentid;Start;temps;

Agent1;1104;11/03/19 08:00;07:00:00
Agent2;1030;11/03/19 07:00;06:00:00
Agent3;1226;11/03/19 08:00;07:00:00
Agent4;1070;11/03/19 11:00;07:00:00
Agent5;1146;11/03/19 08:00;07:00:00
Agent6;1225;11/03/19 08:00;07:00:00
Agent7;1018;11/03/19 08:00;09:00:00
Agent8;1197;11/03/19 12:00;07:00:00
Agent9;1186;11/03/19 CP;CP
Agent10;1167;11/03/19 08:00;07:00:00
Agent11;1036;11/03/19 08:00;06:00:00
Agent12;1058;11/03/19 08:00;07:00:00
Agent13;1037;11/03/19 CM;CM
Agent14;1103;11/03/19 08:00;06:00:00
Agent15;1122;11/03/19 08:00;05:00:00

Agent1;1104;12/03/19 11:00;07:00:00
Agent2;1030;12/03/19 08:00;07:00:00
Agent3;1226;12/03/19 08:00;07:00:00
Agent4;1070;12/03/19 08:00;07:00:00
Agent5;1146;12/03/19 08:00;07:00:00
Agent6;1225;12/03/19 08:00;07:00:00
Agent7;1018;12/03/19 08:00;09:00:00
Agent8;1197;12/03/19 08:00;07:00:00
Agent9;1186;12/03/19 CM;CM
Agent10;1167;12/03/19 12:00;07:00:00
Agent11;1036;12/03/19 08:00;06:00:00
Agent12;1058;12/03/19 07:00;07:00:00
Agent13;1037;12/03/19 CP;CP
Agent14;1103;12/03/19 08:00;06:00:00
Agent15;1122;12/03/19 08:00;05:00:00

 

Labels (1)
3 Replies
ramasaisaksoft

 

Just call that filed in expression of straight table 

load * Inline [
s1,s2
t,2
3,4
1,c
2,d
];

 

sum.PNG

Brett_Bleess
Former Employee
Former Employee

I have looked at things up, down and sideways, and I cannot figure out what the heck is wrong either, Agent 9 and 13 are not appearing, and the above poster is incorrect, changing the Totals does NOT fix the underlying issue of Agent 9 and 13 not appearing here, but I cannot figure out what is wrong either.  I am hoping by posting this, maybe someone else will be able to have a look that is a better developer than am I and spot what we are missing here! 🙂  Sorry I do not have a fix for you.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
hallquist_nate
Partner - Creator III
Partner - Creator III

It is likely "misbehaving" because the expression has to evaluate more than one line to execute the expression and one line has the "CP" or "CM" in the Temps Prod field and one line does not.  this of it like this.

We can test this.  First start with no selections.

Pre-selection.png

Now make a selection...  Notice in the chart where you have selections, the value populates correctly.  This is likely due to the fact that when you select Jour 11, the expression is evaluating a single line.  

Pose Selection.png

I don't have the time today to figure out the correct solution.  However, I can tell you that you have to find a way for your expression to evaluate a single for your nested IF statement to work.  The alternative would be to come up with a different expression, perhaps Set Analysis can be used.  I was able to get the following formula to work in a test instance.

IF((sum({$< jour = {11}>} [temps prod]))<=0, 'CM',
            Interval(sum({$< jour = {11}>} [temps prod]),'hh:mm:ss' ))

 

I have also attached the QVW file I altered for you.

 

Nate