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

How to add 10 different values for same date?

I want to add 10 different values to each day that only  have the value ’00:00:00’ in another field (KLOCKANST)

The values is the same as you see in field "BOLAG" (Bolag02,Bolag04,Bolag,10 ...)

I add the dates that were missing and '00:00:00' in two fields highlighted in yellow. There is a lot of them.

SlaMigg:
LOAD
BOLAG,
DATUMST,
KLOCKANST,
DATUMOP,
KLOCKANOP,
Timmar,
Orsak;
SQL SELECT *
FROM "SLA_MIGG".dbo.Rapportunderlag
WHERE DATUMST >= '2013-03-31' ;

MinMax:
Load
Min(DATUMST) as MinDate,
Max(DATUMST) as MaxDate
resident SlaMigg;
LET vMinDate = Num(Peek('MinDate', 0, 'MinMax'));
LET vMaxDate = Num(Peek('MaxDate', 0, 'MinMax'));
Drop Table MinMax;

Join (SlaMigg)
Load Date(recno()+$(vMinDate)) as DATUMST Autogenerate vMaxDate - vMinDate;

Migg:
NoConcatenate Load DATUMST,
If( IsNull( KLOCKANST ),'00:00:00', KLOCKANST ) as KLOCKANST,
If( IsNull( KLOCKANOP ), '00:00:00', KLOCKANOP ) as KLOCKANOP,
BOLAG,
DATUMOP,
Timmar,
Orsak
Resident SlaMigg
Order By DATUMST ;
Drop Table SlaMigg;

Table.png

the

1 Solution

Accepted Solutions
b04nhu13
Contributor III
Contributor III
Author

I never solved the problem in qlikview. I change the data in SQL instead

View solution in original post

5 Replies
sujeetsingh
Master III
Master III

It really seems correct .

Can you explain in more words.

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

There was no data in Slamigg for those two dates, so all fields other than DATUMST where null after the Join. Your If(IsNull()) logic puts in default values for the KLOCK* fields, but you have not supplied defaults for BOLAG and the other fields when they are null.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
b04nhu13
Contributor III
Contributor III
Author

OK, but it isn´t

As you can see I add dates that were missing highlighted in yellow

But I have nothing in the "BOLAG" field. As you can see I need ten differet values for the same date

b04nhu13
Contributor III
Contributor III
Author

I can add one BOLAG value

IF (IsNull (BOLAG), 'Dummy', BOLAG) as BOLAG

But I want all BOLAG values fore each day; Bolag02, Bolag04 ....

b04nhu13
Contributor III
Contributor III
Author

I never solved the problem in qlikview. I change the data in SQL instead