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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to copy values to next 6 fields of a table

14.08.Value Hero383,52

Hi there,

i am new to qlikview and i hope anybody can help me again.

zzz.jpg

I want to build something like this:

If tmpArt = ValueHero, then copy the value from tmpTeilUmsatz to the next 6 following fields.

i.e.:

14.08.   Value Hero     383,52

15.08.Value Hero383,52
16.08.Value Hero383,52
17.08.Value Hero383,52
18.08.Value Hero383,52
19.08.Value Hero383,52
20.08.  Value Hero 383,52

Thanks and best regards,

Sabrina

15 Replies
MarcoWedel

Hallo Sabrina,

one possible solution could be:

QlikCommunity_Thread_143049_Pic1.JPG.jpg

tabTemp:

LOAD * FROM [http://community.qlik.com/servlet/JiveServlet/download/662458-138544/Mappe2.xlsx] (ooxml, embedded labels, table is Tabelle1);

RENAME Field Start_Datum to Start;

NoConcatenate

tabSales:

LOAD Date(Start+IterNo()-1) as Start_Datum,

    *

While IterNo()<=Days or IterNo()=1;

LOAD *,

    Previous(Start)-Start as Days

Resident tabTemp

Order By Start desc;

DROP Table tabTemp;

DROP Field Start;

hope this helps

regards

Marco

MarcoWedel

if you want to restrict the copies to specific field values, you could try like:

QlikCommunity_Thread_143049_Pic2.JPG.jpg

tabTemp:

LOAD * FROM [http://community.qlik.com/servlet/JiveServlet/download/662458-138544/Mappe2.xlsx] (ooxml, embedded labels, table is Tabelle1);

RENAME Field Start_Datum to Start;

NoConcatenate

tabSales:

LOAD Date(Start+IterNo()-1) as Start_Datum,

     *

While IterNo()<=Days and Art='Value Hero' or IterNo()=1;

LOAD *,

     Previous(Start)-Start as Days

Resident tabTemp

Order By Start desc;

DROP Table tabTemp;

DROP Field Start;

hope this helps

Gruß

Marco

Not applicable
Author

Hi,

its always the next 6 dates:

Excel Row:     12.08.2014     555,55

To load:          13.08.2014     555,55

                       14.08.2014     555,55

                   15.08.2014 555,55
                   16.08.2014 555,55
                   17.08.2014 555,55
                   18.08.2014 555,55

Thanks!!!!

Not applicable
Author

Hi Marco,

thank you so much for your help!

I dont have to fill all the lines until a new "Art", but only the next 6 rows (fields) after a Value Hero.
Any idea how to implement this to your code?

Best regards,

Sabrina

MarcoWedel

While IterNo()<=RangeMin(6,Days) and Art='Value Hero' or IterNo()=1;

simenkg
Specialist
Specialist

if(isnull(tmpArt), Peek(newtmpArt),tmpArt) as newtmpArt,

if(tmpArt='ValueHero',0,Rangesum(Peek(Counter),1)) as Counter,

if(peek(newtmpArt)='ValueHero' and Peek(Counter)<6,Peek(tmpTeilUmsatz),tmpTeilUmsatz) as tmpTeilUmsatz